package net.mysoft.budgetsoft.system.action;

import javax.annotation.Resource;

import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.stereotype.Controller;

import net.mysoft.framework.authority.AccessType;
import net.mysoft.framework.authority.Permission;
import net.mysoft.framework.base.BaseAction;
import net.mysoft.budgetsoft.system.service.ToDoInfoService;
import com.opensymphony.xwork2.ModelDriven;
import net.mysoft.budgetsoft.system.pagemodel.ToDoInfo;
import net.mysoft.framework.model.DataGrid;

//platform/layout/portal/userMain.jsp
@Action(value = "toDoInfoAction", results = {@Result(name = "find", location = "/platform/system/userMain.jsp"),
		@Result(name = "treeList", location = "/platform/system/gongNengAdd.jsp")})
//@Action(value = "toDoInfoAction", results = {@Result(name = "find", location = "/platform/system/gongNeng.jsp")})
@Controller("toDoInfoAction")
public class ToDoInfoAction extends BaseAction implements ModelDriven<ToDoInfo> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Resource
	private ToDoInfoService toDoInfoService;

	@Override
	public ToDoInfo getModel() {
		// TODO Auto-generated method stub
		return null;
	}
	@Permission(access=AccessType.LOGIN)
	public String find() {
		String slq;
		slq="";
		List<ToDoInfo> list =toDoInfoService.find(null);
		DataGrid dGrid=new DataGrid();
		dGrid.setRows(list);
		super.writeJson(dGrid);
	    return "success1";
	}

}
